package com.example.librarymanagement.dto.menu;

import com.example.librarymanagement.entity.Menu;
import com.example.librarymanagement.util.BaseDto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * @author fgba
 */
@EqualsAndHashCode(callSuper = true)
@Data
@Accessors(chain = true)
public class MenuDto extends BaseDto<Menu> {

    private Integer id;

    @ApiModelProperty("父菜单ID，一级菜单为0")
    @NotNull(message = "父菜单ID不能为空")
    private Integer parentId;

    @ApiModelProperty("菜单名称")
    @NotBlank(message = "菜单名称不能为空")
    private String name;

    @ApiModelProperty("菜单URL")
    private String path;

    @ApiModelProperty("权限编码(多个用逗号分隔，如：user:list,user:create)")
    @NotBlank(message = "权限编码不能为空")
    private String perms;

    @ApiModelProperty("菜单组件")
    private String component;

    @ApiModelProperty("菜单类型     0：目录   1：菜单   2：按钮")
    @NotNull(message = "菜单类型不能为空")
    private Integer type;

    @ApiModelProperty("菜单图标")
    private String icon;

    @ApiModelProperty("排序号")
    @NotNull(message = "排序号不能为空")
    private Integer orderNum;

    @ApiModelProperty("菜单状态")
    @NotNull(message = "菜单状态不能为空")
    private Integer state;
}
